using System;
using Microsoft.Practices.ServiceLocation;

namespace F2Enum.Converters
{
    public class ConverterFactory : IConverterFactory
    {

        public IConverter<T> GetConverter<T>()
        {
            return ServiceLocator.Current.GetInstance<IConverter<T>>();
        }

        public IConverter GetConverter(Type converterType)
        {
            return ServiceLocator.Current.GetInstance(typeof (IConverter<>).MakeGenericType(converterType)) as IConverter;
        }
    }
}